package com.project2.controller;

import com.project2.bean.CommonData;
import com.project2.bean.PageBo;
import com.project2.bean.ResultVo;
import com.project2.bean.vo.ReadTopicVo;
import com.project2.service.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/topic")
public class WxTopicController {

    @Autowired
    WxTopicService topicService;

    @RequestMapping("list")
    public ResultVo list(PageBo pageBo){
        CommonData list = topicService.list(pageBo);
        return ResultVo.ok(list);
    }

    @RequestMapping("detail")
    public ResultVo detail(Integer id){
        ReadTopicVo topicDetail = topicService.detail(id);
        return ResultVo.ok(topicDetail);
    }

    @RequestMapping("related")
    public ResultVo related(Integer id){
        CommonData related = topicService.related(id);
        return ResultVo.ok(related);
    }
}
